<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    {include file="public/header"}
    <link type="text/css" rel="stylesheet" href="/public/static/dist/bootstrap-datetimepicker/bootstrap-datetimepicker.min.css"/>
    <script src="/public/static/dist/bootstrap-datetimepicker/bootstrap-datetimepicker.min.js"></script>
    <script src="/public/static/dist/bootstrap-datetimepicker/bootstrap-datetimepicker.zh-CN.js"></script>
    <script src="/public/static/dist/wangEditor/wangEditor.min.js"></script>
    <style>
      #edit-table th{
        width:100px;
      }
    </style>
  </head>
  <body>
    <div class="container-fluid">
      <form class="form form-inline">
        <input class="form-control" name="search_title" placeholder="标题"/>
        <input class="form-control" name="search_key_word" placeholder="关键字"/>
        <button class="btn btn-primary">搜索</button>
      </form>
      <table class="table">
        <thead>
          <tr>
            <td>sdf</td>
            <td>sdf</td>
            <td>sdf</td>
            <td>sdf</td>
          </tr>
        </thead>
      </table>
    </div>
  </body>
</html>
<script>
  //日期选择初始化
  var dataPickerOpt = {
    format: "yyyy-mm-dd",
    autoclose:true,
    language:'zh-CN',
    todayHighlight: true,
    minView:2,
    todayBtn:true,
  };
  $('input[name=start_time]').datetimepicker(dataPickerOpt).on("changeDate", function(e){
    $('input[name=end_time]').datetimepicker("setStartDate",e.date);
  });
  $('input[name=end_time]').datetimepicker(dataPickerOpt).on("changeDate", function(e){
    $('input[name=start_time]').datetimepicker("setEndDate",e.date);
  });

  //富文本编辑器初始化
  var E = window.wangEditor
  var editor = new E('#editor')
  // 或者 var editor = new E( document.getElementById('editor') )
  editor.customConfig.uploadImgServer = '/public/admin/Post/upload'  // 上传图片到服务器
  editor.create();
  editor.customConfig.uploadImgHooks = {
    fail: function (xhr, editor, result) {
      for(var k in result['data']){
        insertImg(result['data'][k]);
      }
    }
  };
</script>